---
#
# These tasks only run on koji db servers from the postgresql playbook
#
#
# create a koji db user to own the db with the kojidatabasepassword from private
#
- name: koji db user
  postgresql_user: name=koji password={{ aarch64kojidatabasepassword }}
  tags:
  - db
  when: is_kojidb == "True"
#
# create a koji database if not already created
#
- name: databases creation
  postgresql_db: name=koji owner=koji encoding=UTF-8
  tags:
  - db
  when: is_kojidb == "True"
# 
# Load the initial schema and create a file to note that it's loaded now. 
#
- name: load initial schema
  shell: creates=/var/lib/pgql/koji-schema psql koji koji < /usr/share/doc/koji*/docs/schema.sql
  tags:
  - db
  when: is_kojidb == "True"

